<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var managerCookie = {
        set: function (name, value, date) {
          document.cookie = name + '=' + value + ';' + 'max-age=' + date;
        },
        get: function () {
          console.log(document.cookie);
        },
        remove: function () {
          this.set(name, '', 0);
        },
      };
      managerCookie.set('left', 100, 20);
      managerCookie.get();
    </script>
  </body>
</html>
